/*解析url查询字符串
 
 * @example ?id=123&a=b
 * @return Object {id:123,a:b}
 * */
export function urlParse(){
	let url = window.location.search;
	let obj = {};
	let reg = /[?&][^?&]+=[^?&]+/g;
	let arr = url.match(reg);
	if(arr){
		arr.forEach((item)=>{
			let tempArr = item.substring(1).split('=');
			var key = tempArr[0]
			var val = tempArr[1]
			obj[key] = val;
		})
	}
	return obj
}
